package controller

import (
	"go-gin-api/app/service/other"

	"github.com/gin-gonic/gin"
)

// GetGithubList 获取开源列表
func GetGithubList(c *gin.Context) {
	res := other.GetGitHub(c)
	c.JSON(200, res)
}

// AddGithub 添加开源项目
func AddGithub(c *gin.Context) {
	var s other.AddGithubService
	if c.BindJSON(&s) == nil {
		res := s.AddGithub(c)
		c.JSON(200, res)
	}
}

// GetGithubByID 根据id获取详情
func GetGithubByID(c *gin.Context) {
	res := other.GetGithubDetailByID(c)
	c.JSON(200, res)
}

// DeleteGithubByID 删除项目根据id
func DeleteGithubByID(c *gin.Context) {
	res := other.DeleteGithubByID(c)
	c.JSON(200, res)
}

// UploadImage 上传图片
func UploadImage(c *gin.Context) {
	res := other.UploadImagesService(c)
	c.JSON(200, res)
}

// GetImagesList 图片列表
func GetImagesList(c *gin.Context) {
	res := other.GetImagesService(c)
	c.JSON(200, res)
}
